﻿using System.Data.Entity.ModelConfiguration;

namespace CIK.News.Domain.Mappings
{
    public class ItemContentMapping : EntityMappingBase<ItemContent>
    {
        public ItemContentMapping()
        {
            Property(x => x.Title).IsRequired();
            Property(x => x.SortDescription).IsRequired();
            Property(x => x.Content).IsRequired();
            Property(x => x.SmallImage).IsRequired();
            Property(x => x.MediumImage).IsRequired();
            Property(x => x.BigImage).IsRequired();
            Property(x => x.NumOfView).IsRequired();

            HasMany(x => x.Items).WithRequired(y=>y.ItemContent);

            ToTable("ItemContent");
        }
    }
}